package com.wujing.scala.first5day

import scala.io.StdIn


/***
 *  可以从控制台接收用户信息 姓名年龄
 *
 */
object operationDemo2 {
  def main(args: Array[String]): Unit = {
    println("请输入姓名")
    Stu.name= StdIn.readLine()
    println("请输入年龄")
    Stu.age= StdIn.readInt()
    Stu.sayHi
  }
}

object Stu{
  var name = ""
  var age= 0
  def sayHi={
    printf("student name:%s,age is : %d",name,age)
  }
}